package com.example.demo.service.impl.muban;

import org.springframework.stereotype.Component;
import lombok.Data;

@Component
public class ItemInfoBlock extends AbstractTemplateBlock<ItemInfoBlock.ItemInfo> {
    @Override
    protected ItemInfoBlock.ItemInfo initBlock() {
        return new ItemInfoBlock.ItemInfo();
    }

    // 模拟业务逻辑，组装返回商品信息模块数据
    @Override
    protected void doWork(ModelContainer modelContainer, ItemInfo block) throws Exception {
        block.setItemId(123L);
        block.setItemName("测试");
    }
    @Data
    public static class ItemInfo {
        private Long itemId;
        private String itemName;
    }
}